﻿<%@ Page Language="C#" MasterPageFile="../main.master" Inherits="VioletDevelopmentLaboratory.Net.Web.Configuration.VWebConfigManagerPage" %>

<script runat="server">
	protected void TrustDetailsView_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
	{
		ShowAlert_DetailsView_ItemUpdated(e);
	}
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPlaceHolder" runat="server">

	<h2>Trust</h2>

	<div>
		<asp:ObjectDataSource ID="TrustDetailsViewDataSource" runat="server" 
			SelectMethod="GetTrustSection" 
			TypeName="VioletDevelopmentLaboratory.Net.Web.Configuration.TrustSectionManager" 
			UpdateMethod="Modify">
			<UpdateParameters>
				<asp:Parameter Name="level" Type="String" />
				<asp:Parameter Name="originUrl" Type="String" />
				<asp:Parameter Name="processRequestInApplicationTrust" Type="Boolean" />
			</UpdateParameters>
		</asp:ObjectDataSource>
		<fieldset>
			<asp:DetailsView ID="TrustDetailsView" runat="server" AutoGenerateRows="False" 
				CellPadding="5" DataSourceID="TrustDetailsViewDataSource" DefaultMode="Edit" 
				onitemupdated="TrustDetailsView_ItemUpdated">
				<Fields>
					<asp:TemplateField HeaderText="Level" SortExpression="Level">
						<EditItemTemplate>
							<asp:DropDownList ID="LevelDropDownList" runat="server" 
								SelectedValue='<%# Bind("Level") %>'>
								<asp:ListItem>Full</asp:ListItem>
								<asp:ListItem>High</asp:ListItem>
								<asp:ListItem>Medium</asp:ListItem>
								<asp:ListItem>Low</asp:ListItem>
								<asp:ListItem>Minimal</asp:ListItem>
							</asp:DropDownList>
						</EditItemTemplate>
					</asp:TemplateField>
					<asp:BoundField DataField="OriginUrl" HeaderText="OriginUrl" 
						SortExpression="OriginUrl" />
					<asp:CheckBoxField DataField="ProcessRequestInApplicationTrust" 
						HeaderText="ProcessRequestInApplicationTrust" 
						SortExpression="ProcessRequestInApplicationTrust" />
					<asp:CommandField ButtonType="Button" ShowCancelButton="False" 
						ShowEditButton="True" />
				</Fields>
			</asp:DetailsView>
		</fieldset>
	</div>
</asp:Content>